home *** CD-ROM | disk | FTP | other *** search
/ Suzy B Software 2 / Suzy B Software CD-ROM 2 (1994).iso / extras / programm / gemfsc19 / gemfsc19.lzh / GEMFUNCS / OBJBMBTN.C < prev    next >
C/C++ Source or Header  |  1993-05-07  |  931b  |  34 lines

  1. /**************************************************************************
  2.  * OBJBMBTN.C - The obj_bmbuttons() function.
  3.  *************************************************************************/
  4.  
  5. #include "gemfintl.h"
  6.  
  7. short obj_bmbuttons(ptree, parent, selstate, newbits)
  8.     register OBJECT  *ptree;
  9.     register short      parent;
  10.     register short      selstate;
  11.     register short      newbits;
  12. {
  13.     register OBJECT  *pobj;
  14.     register short      state;
  15.     register short      xtype;
  16.     register short      oldbits = 0;
  17.     register short      curobj  = ptree[parent].ob_head;
  18.  
  19.     while(curobj != parent && curobj != -1) {
  20.         pobj  = &ptree[curobj];
  21.         xtype = OBXTYPE(pobj);
  22.         state = pobj->ob_state;
  23.         if (state & selstate) {
  24.             oldbits |= xtype;
  25.         }
  26.         if (newbits != OBJ_BMINQUIRE) {
  27.             pobj->ob_state = (newbits & xtype) ?
  28.                                 (state | selstate) : (state & ~selstate);
  29.         }
  30.         curobj = ptree[curobj].ob_next;
  31.     }
  32.     return oldbits;
  33. }
  34.